<template name="popup">
	<view @touchmove.stop.prevent="clear" v-if="showPopup">
		<view class="popup_mask" @touchmove.stop.prevent="clear"></view>
		<view class="popup_content">
			<view class="title">{{title}}</view>
			<view class="explain_text">
				<view class="line">
		         电话:
					<navigator @click="activeurl1"  :url="protocolPath" class="path" hover-class="navigator-hover">181 434 19820</navigator><br/><br/>网址:<navigator @click="activeurl" :url="policyPath" class="path" hover-class="navigator-hover">odoo</navigator>
				<br/>
				</view>
			</view>

			<view class="button">
				<!-- <view class="back" @tap="back">暂不使用</view> -->
				<view class="consent" @tap="consent">关闭</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "popup",
		props: {
			title: {
				type: String,
				default: "odoo app 二次开发"
			},
			// 协议路径
			protocolPath: {
				type: String,
				default:"#"
			},
			// 政策路径
			policyPath: {
				type: String,
				default:"#"
			}
		},
		data() {
			return {
				showPopup: false
			};
		},
		methods: {
			// 禁止滚动
			clear() {
				return;
			},
			back() {
				// #ifdef APP-PLUS  
				plus.runtime.quit();
				// #endif
			},
			// 关闭弹框
			consent() {
				this.showPopup = false;
				this.$emit('popupState', true)
			},
			activeurl(){
				plus.runtime.openURL("odoo app")
			},
			activeurl1(){
			uni.makePhoneCall({ 
				phoneNumber: '181 434 19820'
			});
			}
			
		}
	};
</script>

<style lang="less">
	.popup_mask {
		position: fixed;
		bottom: 0;
		top: 0;
		left: 0;
		right: 0;
		background-color: rgba(0, 0, 0, 0.4);
		transition-property: opacity;
		transition-duration: 0.3s;
		opacity: 0;
		z-index: 98;
		
	}

	.popup_mask {
		opacity: 1;
	}

	.popup_content {
		overflow: hidden;
		box-sizing: border-box;
		padding: 40upx 20upx 0 20upx;
		position: fixed;
		bottom: 30%;
		border-radius: 8px;
		left: 50%;
		margin-left: -40%;
		right: 0;
		min-height: 400upx;
		background: #ffffff;
		width: 80%;
		z-index: 1000;

		.title {
			text-align: center;
			font-size: 34upx;
			padding: 10upx 0 0 0;
		}

		.explain_text {
			font-size: 30upx;
			padding: 30upx 30upx 40upx 30upx;
			line-height: 38upx;

			.line {
				display: block;

				.path {
					color: #007aff;
					display: inline-block;
					text-align: center;
				}
			}
		}

		.button {
			display: flex;
			padding: 20upx;
			align-items: center;
			font-size: 34upx;
			justify-content: space-around;
			border-top: 1upx solid #f2f2f2;

			view {
				text-align: center;
			}
		}
	}
</style>
